package com.batchaps.gameentity;

import javax.microedition.lcdui.Graphics;

import com.batchaps.classes.Sprite2D;

public abstract class VisibleGameEntity {
	protected Sprite2D[] _sprites;
	protected int _nSprites;
	protected int _width;
	protected int _height;
	protected float _posX;
	protected float _posY;
	
	public void Draw(Graphics g){
		for(int i=0; i < _nSprites ;i++){
			_sprites[i].Draw(g);
		}
	}
	
	public abstract void Update();
	
	public boolean IsInteracted(int x, int y , int idx){
		if(_sprites[idx].IsMouseInteract(x, y)){
			return true;
		}
		return false;
	}

	public Sprite2D[] get_sprites() {
		return _sprites;
	}

	public void set_sprites(Sprite2D[] _sprites) {
		this._sprites = _sprites;
	}

	public int get_nSprites() {
		return _nSprites;
	}

	public void set_nSprites(int _nSprites) {
		this._nSprites = _nSprites;
	}

	public int get_width() {
		return _width;
	}

	public void set_width(int _width) {
		this._width = _width;
	}

	public int get_height() {
		return _height;
	}

	public void set_height(int _height) {
		this._height = _height;
	}

	public float get_posX() {
		return _posX;
	}

	public void set_posX(float _posX) {
		this._posX = _posX;
	}

	public float get_posY() {
		return _posY;
	}

	public void set_posY(float _posY) {
		this._posY = _posY;
	}
}
